<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>资金管理</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../../include/commonFile.jsp" %>
</head>
<body>
<!--头部-->
<%@include file="../../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <%--<%@include file="fundManaIndex.jsp" %>--%>
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <ul class="layui-tab-title">
                    <li><span class="title f18 ml5 mr5">全部资金</span></li>
                    <li><span class="title f18 ml5 mr5">众筹资金</span></li>
                    <li class="layui-this"><span class="title f18 ml5 mr5">活动资金</span></li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item"></div>
                    <div class="layui-tab-item"></div>
                    <div class="layui-tab-item layui-show">
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <form class="layui-form" action="${ctx}/charge/package/packageMemberList.do" id="myForm"
                                      method="post">
                                    <input type="hidden" name="pageNo" id="pageNos" value="${page.page}"/>
                                    <div class="f-search-bar">
                                        <div class="search-container">
                                            <ul class="search-form-content">
                                                <li class="form-item"><label class="search-form-lable">套餐类型</label>
                                                    <div class="check-btn-inner">
                                                        <a href="javascript:void(0);"
                                                           onclick="setTimeType($(this),'1','#myForm')" ${type == 1 ? 'class="active"' : ''}>升级</a>
                                                        <a href="javascript:void(0);"
                                                           onclick="setTimeType($(this),'2','#myForm')" ${type == 2 ? 'class="active"' : ''}>增值服务</a>
                                                        <a href="javascript:void(0);"
                                                           onclick="setTimeType($(this),'3','#myForm')" ${type == 3 ? 'class="active"' : ''}>短信购买</a>
                                                        <input type="hidden" name="type" value="3"/>
                                                    </div>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div
                        <div class="my-act-list-content">
                            <div class="cl">
                                <table class="layui-table">
                                    <colgroup>
                                        <col>
                                        <col>
                                        <col>
                                        <col>
                                        <col>
                                        <c:if test="${type == 3}">
                                            <col>
                                            <col>
                                        </c:if>
                                    </colgroup>
                                    <thead>
                                    <tr>
                                        <c:if test="${type == 3}">
                                            <th>短信来源</th>
                                            <th>套餐名称</th>
                                            <th>数量</th>
                                            <th>费用</th>
                                            <th>支付方式</th>
                                            <th>日期</th>
                                            <th>状态</th>
                                        </c:if>
                                        <c:if test="${ type == 2 or type == 1}">
                                            <th>套餐名称</th>
                                            <th>费用</th>
                                            <th>支付方式</th>
                                            <th>日期</th>
                                            <th>状态</th>
                                        </c:if>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:if test="${page.totalCount == 0}">
                                        <tr>
                                            <td colspan="${type == 1 || type == 2 ? 5 : 7}">
                                                <div class="f16 tc">还没有明细记录</div>
                                            </td>
                                        </tr>
                                    </c:if>
                                    <c:forEach var="packageMember" items="${pmList}">
                                        <tr>
                                            <c:if test="${type == 3}">
                                                <td>
                                                    <c:if test="${packageMember.smsSource == 1}">
                                                        免费领取
                                                    </c:if>
                                                    <c:if test="${packageMember.smsSource == 2}">
                                                        用户购买
                                                    </c:if>
                                                    <c:if test="${packageMember.smsSource == 3}">
                                                        系统赠送
                                                    </c:if>
                                                </td>
                                                <td>${packageMember.packageName}</td>
                                                <td>${packageMember.quantity}</td>
                                                <td>
                                                    <c:if test="${empty packageMember.price }">
                                                        0.00
                                                    </c:if>
                                                    <c:if test="${not empty packageMember.price}">
                                                        <fmt:formatNumber pattern="0.00" value="${packageMember.price}"/>
                                                    </c:if>
                                                </td>
                                                <td>
                                                    <c:if test="${packageMember.payWay == 0}">
                                                        支付宝
                                                    </c:if>
                                                    <c:if test="${packageMember.payWay == 1}">
                                                        微信
                                                    </c:if>
                                                </td>
                                                <td>
                                                    <fmt:formatDate value="${packageMember.createDate}" pattern="yyyy-MM-dd HH:mm"/>
                                                </td>
                                                <td>
                                                    <c:if test="${packageMember.payStatus == 1}">
                                                        待支付
                                                    </c:if>
                                                    <c:if test="${packageMember.payStatus == 2}">
                                                        <c:if test="${packageMember.price > 0.0}">
                                                            支付成功
                                                        </c:if>
                                                        <c:if test="${packageMember.price == 0.0}">
                                                            免费赠送
                                                        </c:if>
                                                    </c:if>
                                                </td>
                                            </c:if>
                                            <c:if test="${ type == 2 or type == 1}">
                                                <td>${packageMember.packageName}</td>
                                                <td>
                                                    <c:if test="${empty packageMember.price }">
                                                        0
                                                    </c:if>
                                                    <c:if test="${not empty packageMember.price}">
                                                        <fmt:formatNumber pattern="0.00" value="${packageMember.price}"/>
                                                    </c:if>
                                                </td>
                                                <td>
                                                    <c:if test="${packageMember.payWay == 0}">
                                                        支付宝
                                                    </c:if>
                                                    <c:if test="${packageMember.payWay == 1}">
                                                        微信
                                                    </c:if>
                                                </td>
                                                <td>
                                                    <fmt:formatDate value="${packageMember.createDate}" pattern="yyyy-MM-dd HH:mm"/>
                                                </td>
                                                <td>
                                                    <c:if test="${packageMember.payStatus == 1}">
                                                        待支付
                                                    </c:if>
                                                    <c:if test="${packageMember.payStatus == 2}">
                                                        <c:if test="${packageMember.price > 0.0}">
                                                            支付成功
                                                        </c:if>
                                                        <c:if test="${packageMember.price == 0.0}">
                                                            免费赠送
                                                        </c:if>
                                                    </c:if>
                                                </td>
                                            </c:if>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="page-content">
                            <div id="page_content" class="page-container"></div>
                        </div>
                    </div>
                    <div class="layui-tab-item"></div>
                    <div class="layui-tab-item"></div>
                </div>
            </div>
        </div><!--底部-->
        <%@include file="../../include/footer.jsp" %>
    </section>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript">

    $(function () {
        txz.initHeader({
            nav:[ {
                name: '资金管理',
                curr: true
            }]
        });

        layui.use([ 'element' ], function() {
            var element = layui.element;

            element.on('tab', function (data) {
                if (data.index == 0) {
                    location.href = "${ctx}/order/order/orderList.do";
                } else if(data.index == 1){
                    location.href = "${ctx}/order/order/withdrawList.do";
                } else if (data.index == 2) {
                    //location.href = "${ctx}/order/order/tradeList.do";
                    location.href = "${ctx}/charge/package/packageMemberList.do";

                }
            });
        });
        //加载分页
        loadPageNew({
            elem: 'page_content',
            totalCount: '${page.totalCount}',
            limit: '${page.limit}',
            page: '${page.page}'
        });
    })
</script>
</body>
</html>